
//
//  PowerDetailViewController.m
//  muscleLife
//
//  Created by xalo on 16/5/3.
//  Copyright © 2016年 HeavenAndHell. All rights reserved.
//

#import "PowerDetailViewController.h"

@interface PowerDetailViewController ()<UIWebViewDelegate,MBProgressHUDDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property(nonatomic, retain)MBProgressHUD* hud;
@end

@implementation PowerDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self setMBPrograss];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)loadHtml{

    NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.model.url]];

    [self.webView loadRequest:request];
}

-(void)setMBPrograss{

    self.hud = [MBProgressHUD showHUDAddedTo:self.webView animated:YES];

//    self.hud .mode = MBProgressHUDModeDeterminate;
    self.hud .detailsLabelText = @"正在拼命加载...";
    self.hud .labelText = @"请稍等";
    [self loadHtml];
//    dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
//        [self loadHtml];
//    });

}

-(void)webViewDidFinishLoad:(UIWebView *)webView{

    [self.hud hide:YES];

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
